<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: ActionView::Helpers::FormOptionsHelper</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">ActionView::Helpers::FormOptionsHelper</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/plugins/active_scaffold/lib/helpers/usa_state_rb.html">
                vendor/plugins/active_scaffold/lib/helpers/usa_state.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000067">usa_state_options_for_select</a>&nbsp;&nbsp;
      <a href="#M000066">usa_state_select</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">


    <div id="constants-list">
      <h3 class="section-bar">Constants</h3>

      <div class="name-list">
        <table summary="Constants">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">USASTATES</td>
          <td>=</td>
          <td class="context-item-value">[[&quot;Alabama&quot;, &quot;AL&quot;], [&quot;Alaska&quot;, &quot;AK&quot;], [&quot;Arizona&quot;, &quot;AZ&quot;], [&quot;Arkansas&quot;, &quot;AR&quot;], [&quot;California&quot;, &quot;CA&quot;], [&quot;Colorado&quot;, &quot;CO&quot;], [&quot;Connecticut&quot;, &quot;CT&quot;], [&quot;Delaware&quot;, &quot;DE&quot;], [&quot;District of Columbia&quot;, &quot;DC&quot;], [&quot;Florida&quot;, &quot;FL&quot;], [&quot;Georgia&quot;, &quot;GA&quot;], [&quot;Hawaii&quot;, &quot;HI&quot;], [&quot;Idaho&quot;, &quot;ID&quot;], [&quot;Illinois&quot;, &quot;IL&quot;], [&quot;Indiana&quot;, &quot;IN&quot;], [&quot;Iowa&quot;, &quot;IA&quot;], [&quot;Kansas&quot;, &quot;KS&quot;], [&quot;Kentucky&quot;, &quot;KY&quot;], [&quot;Louisiana&quot;, &quot;LA&quot;], [&quot;Maine&quot;, &quot;ME&quot;], [&quot;Maryland&quot;, &quot;MD&quot;], [&quot;Massachusetts&quot;, &quot;MA&quot;], [&quot;Michigan&quot;, &quot;MI&quot;], [&quot;Minnesota&quot;, &quot;MN&quot;], [&quot;Mississippi&quot;, &quot;MS&quot;], [&quot;Missouri&quot;, &quot;MO&quot;], [&quot;Montana&quot;, &quot;MT&quot;], [&quot;Nebraska&quot;, &quot;NE&quot;], [&quot;Nevada&quot;, &quot;NV&quot;], [&quot;New Hampshire&quot;, &quot;NH&quot;], [&quot;New Jersey&quot;, &quot;NJ&quot;], [&quot;New Mexico&quot;, &quot;NM&quot;], [&quot;New York&quot;, &quot;NY&quot;], [&quot;North Carolina&quot;, &quot;NC&quot;], [&quot;North Dakota&quot;, &quot;ND&quot;], [&quot;Ohio&quot;, &quot;OH&quot;], [&quot;Oklahoma&quot;, &quot;OK&quot;], [&quot;Oregon&quot;, &quot;OR&quot;], [&quot;Pennsylvania&quot;, &quot;PA&quot;], [&quot;Rhode Island&quot;, &quot;RI&quot;], [&quot;South Carolina&quot;, &quot;SC&quot;], [&quot;South Dakota&quot;, &quot;SD&quot;], [&quot;Tennessee&quot;, &quot;TN&quot;], [&quot;Texas&quot;, &quot;TX&quot;], [&quot;Utah&quot;, &quot;UT&quot;], [&quot;Vermont&quot;, &quot;VT&quot;], [&quot;Virginia&quot;, &quot;VA&quot;], [&quot;Washington&quot;, &quot;WA&quot;], [&quot;Wisconsin&quot;, &quot;WI&quot;], [&quot;West Virginia&quot;, &quot;WV&quot;], [&quot;Wyoming&quot;, &quot;WY&quot;]] unless const_defined?(&quot;USASTATES&quot;)</td>
        </tr>
        </table>
      </div>
    </div>



      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000067" class="method-detail">
        <a name="M000067"></a>

        <div class="method-heading">
          <a href="#M000067" class="method-signature">
          <span class="method-name">usa_state_options_for_select</span><span class="method-args">(selected = nil, priority_states = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns a string of option tags for the states in the United States. Supply
a state name as +selected to have it marked as the selected option tag.
Included also is the option to set a couple of <tt>priority_states</tt> in
case you want to highligh a local area NOTE: Only the option tags are
returned from this method, wrap it in a &lt;select&gt;
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000067-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/helpers/usa_state.rb, line 15</span>
15:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">usa_state_options_for_select</span>(<span class="ruby-identifier">selected</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">priority_states</span> = <span class="ruby-keyword kw">nil</span>)
16:         <span class="ruby-identifier">state_options</span> = <span class="ruby-value str">&quot;&quot;</span>
17:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">priority_states</span>
18:           <span class="ruby-identifier">state_options</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">options_for_select</span>(<span class="ruby-identifier">priority_states</span>, <span class="ruby-identifier">selected</span>)
19:           <span class="ruby-identifier">state_options</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;&lt;option&gt;-------------&lt;/option&gt;\n&quot;</span>
20:         <span class="ruby-keyword kw">end</span>
21: 
22:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">priority_states</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">priority_states</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">selected</span>)
23:           <span class="ruby-identifier">state_options</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">options_for_select</span>(<span class="ruby-constant">USASTATES</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">priority_states</span>, <span class="ruby-identifier">selected</span>)
24:         <span class="ruby-keyword kw">else</span>
25:           <span class="ruby-identifier">state_options</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">options_for_select</span>(<span class="ruby-constant">USASTATES</span>, <span class="ruby-identifier">selected</span>)
26:         <span class="ruby-keyword kw">end</span>
27: 
28:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">state_options</span>
29:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000066" class="method-detail">
        <a name="M000066"></a>

        <div class="method-heading">
          <a href="#M000066" class="method-signature">
          <span class="method-name">usa_state_select</span><span class="method-args">(object, method, priority_states = nil, options = {}, html_options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Return a full select and option tags for the given object and method, using
<a href="FormOptionsHelper.html#M000067">usa_state_options_for_select</a>
to generate the list of option &lt;tags&gt;.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000066-source">
<pre>
   <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/helpers/usa_state.rb, line 6</span>
6:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">usa_state_select</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">priority_states</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">options</span> = {}, <span class="ruby-identifier">html_options</span> = {})
7:         <span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword kw">self</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:object</span>)).<span class="ruby-identifier">to_usa_state_select_tag</span>(<span class="ruby-identifier">priority_states</span>, <span class="ruby-identifier">options</span>, <span class="ruby-identifier">html_options</span>)
8:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>